package vista;

import java.awt.Color;

import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.JComboBox;
import javax.swing.JTable;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;

import controlador.Controlador;
import modelo.dao.DAO;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class PanelCartas extends JPanel {
	private JTable table;
	private DAO dao;
	private Controlador controlador;
	private JPanel actual;

	/**
	 * Create the panel.
	 */
	public PanelCartas(DAO d, Controlador c) {
		setBackground(Color.GRAY);
		setLayout(null);
		setSize(1024,768);
		this.dao = d;
		this.controlador = c;
		this.actual = this;
		
		JComboBox comboBoxFiltro = new JComboBox();
		comboBoxFiltro.setBounds(10, 44, 132, 20);
		add(comboBoxFiltro);
		
		table = new JTable();
		table.setBounds(10, 114, 785, 314);
		add(table);
		
		JButton btnNewButton = new JButton("Modificar Carta");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				Ventana topFrame = (Ventana) SwingUtilities.getWindowAncestor(actual);
				JPanel next = new PanelPlatos(dao, controlador);
				topFrame.setContentPane(next);
			}
		});
		btnNewButton.setBounds(10, 440, 255, 169);
		add(btnNewButton);
		
		JButton btnNewButton_1 = new JButton("Eliminar Carta");
		btnNewButton_1.setBounds(275, 439, 255, 170);
		add(btnNewButton_1);
		
		JLabel lblNewLabel = new JLabel("New label");
		lblNewLabel.setBounds(10, 11, 132, 14);
		add(lblNewLabel);
		
		JButton btnVolver = new JButton("Volver");
		btnVolver.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				Ventana topFrame = (Ventana) SwingUtilities.getWindowAncestor(actual);
				JPanel next = new PanelPrincipal(dao, controlador);
				topFrame.setContentPane(next);				
			}
		});
		btnVolver.setBounds(540, 439, 255, 170);
		add(btnVolver);
	}
}
